/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package objects;

import java.util.HashMap;
import klient.Klient;

/**
 *
 * @author Marcin
 */
public class Font2dBase {
    
    public static HashMap<String,Font2d> list= new HashMap<>();
    
    public static boolean check(String str,int size){
        String out=""+size+"|"+str;
        return list.containsKey(out);
    }
    
    public static Font2d get(String str,int size){
        if(check(str,size)){
            Klient.log("Użyto: "+str+" rozmiar "+size);
            return list.get(""+size+"|"+str);
        }else{
            Font2d f = new Font2d();
            f.init(str,size);
            list.put(""+size+"|"+str, f);
            Klient.log("Załadowano: "+str+" rozmiar "+size);
            return f;
        }
    }
}
